<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        var arr= new Array(Number(prompt('输入班级人数')))
        for(let i=1;i<arr.length+1;i++ ){
            arr.push(prompt('输入第'+i+'个人的成绩'))
            arr.shift()
        }
        arr.sort()
        console.log(arr);

        for(let z=0;z<arr.length-1;z++){
            var chenji=Number(arr[z])+Number(arr[z+1])
        }
        console.log('总成绩：'+chenji);



        for(let j=0;j<arr.length-1;j++){
            var chenji=Number(arr[j])+Number(arr[j+1])
            var pingjun=chenji/arr.length
        }
        console.log('平均成绩：'+pingjun);


        var max
        var mim
        if(arr.length == 1){
            max=arr[0]
            min=max
            console.log('最高分'+max);
            console.log('最高分'+max);
        }else{
            console.log(arr)
            max=arr[length - 1]
            min=arr[0]
            console.log('最高分'+max);
            console.log('最低分'+min);
        }
    </script>
</body>
</html>